Computer programs are groups of instructions that describe actions to be performed by a computer or other processor-based device. When a computer program is loaded and executed on computer hardware, the computer will behave in a predetermined manner by following the instructions of the computer program. Accordingly, the computer becomes a specialized machine that performs the tasks prescribed by the instructions.
A programmer using one or more programming languages creates the instructions comprising a computer program. Typically, source code is specified or edited by a programmer manually and/or with help of an integrated development environment (IDE). Subsequently, the source code can be compiled or otherwise transformed by another program into computer instructions executable by a computer or like device.
In software engineering, a plurality of design patterns are conventionally utilized in program development. A design pattern provides a framework for describing a particular issue and solutions thereto. More specifically, a design pattern is a general, repeatable solution for common issues that occur in software design. Among other things, use of design patterns speeds up development, helps prevent subtle issues and improves program readability and comprehension by those familiar with the pattern.
One basic design pattern is producer/consumer. A producer/consumer relationship is one in which a producer generates data and the consumer uses the data. This pattern is utilized in a myriad of different environments for a number of processes including, at a higher level, data warehousing for cleansing and transforming data and image processing for iterative refinement. In fact, the pattern can apply to any situation in which data is produced and consumed. One particularly prevalent use case pertains to queries.
Query execution can be seen as a traditional client/server or consumer/producer model where an entity A requests a service from another entity B, in this case the retrieval of some data that satisfies criteria and is in the shape requested. Some bi-directional communication mechanism is required such that A can instruct B about its desire and so that B may respond to A with the results. The entire result set is returned in some form and thereafter consumed for some purpose. Conventional relational database management software (RDBMS) employs cursors for the output interface with which to stream query output to the consumer. A cursor is a single stream of data that facilitates supply of data in some definite, sequential ordering.